package net.spunofbook;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

public class TelaVendaCadastro extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.tela_venda_cadastro);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		super.onCreateOptionsMenu(menu);
		getMenuInflater().inflate(R.menu.tela_venda_cadastro, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		super.onOptionsItemSelected(item);
		Context v = getBaseContext();
		switch (item.getItemId()) {
		case R.id.telaVendaCadastroMenu_inicio:
			chamarTelaInicio(v);
			break;

		case R.id.telaVendaCadastroMenu_venda:
			chamarTelaVenda(v);
			break;

		default:
			break;
		}

		return true;
	}

	private void chamarTelaInicio(Context context) {
		startActivity(new Intent(context, TelaPrincipal.class));
		finish();
	}

	private void chamarTelaVenda(Context context) {
		startActivity(new Intent(context, TelaVendaCadastro.class));
		finish();
	}
}
